/* 
 * File:   Button.cpp
 * Author: Erwin
 * 
 * Created on 21 juni 2010, 16:32
 */

#include "Button.h"

void Button::setListener(ButtonListener lst){
    this->bl = lst;
}

unsigned char Button::buttonDown(){
    if(mkt_kbd_is_pressed(mtk_key)){
        this->status = DOWN;
        return this->status;
    }
    return 0;
}

unsigned char Button::buttonUp(){
    if(mkt_kbd_is_pressed(mtk_key)){
        this->status = UP;
        return this->status;
    }   
    return 0;
}

unsigned char Button::getStatus(){
    return status;
}

void Button::setButton(mkt_key_enum key){
    this->mtk_key = key;
    this->status = UP;
}
